﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string username = (string)Session["username"];
            if (username != null)
            {
                Response.Write($"你的用户名为：{username}");
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string username = (string)Session["username"];
            string password = (string)Session["password"];
            if (username == TextBox1.Text && password == TextBox2.Text)
            {
                Literal1.Text = "登陆成功";
                Response.Redirect("WebForm3.aspx");
            }
            else
            {
                Literal1.Text = "输入错误，请重新输入";
            }
        }
    }
}